package GroupChats;

import java.io.DataInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class Server {
    public static List<Socket> socketList = new ArrayList<>();
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(9999);

        while (true){
            Socket socket = serverSocket.accept();
            new ThreadServer(socket).start();
            socketList.add(socket);
            System.out.println(socket.getRemoteSocketAddress() + " 已上线啦!!!!");
        }

    }
}
